package com.zxn.tablayoutsamples.ui

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.zxn.tablayout.CommonTabLayout
import com.zxn.tablayout.LottieTabLayout
import com.zxn.tablayout.listener.ILottieTabEntity
import com.zxn.tablayoutsamples.R
import com.zxn.tablayoutsamples.entity.AnimTabEntity
import com.zxn.tablayoutsamples.entity.MenuTabEntity

/**
 *  Created by zxn on 2021/9/24.
 */
class LottieTabLayoutActivity : AppCompatActivity() {

    private val mTitles = arrayOf("", "", "", "", "")

    private val mIconUnselectIds = intArrayOf(
        R.mipmap.tab_home_unselect, R.mipmap.tab_speech_unselect,
        R.mipmap.tab_contact_unselect, R.mipmap.tab_more_unselect, R.mipmap.tab_more_unselect
    )

    private val mIconSelectIds = intArrayOf(
        R.mipmap.tab_home_select, R.mipmap.tab_speech_select,
        R.mipmap.tab_contact_select, R.mipmap.tab_more_select, R.mipmap.tab_more_select
    )

    private val mUnselectAssetNameArray = arrayOf("","","","")

    private val mSelectAssetNameArray = arrayOf("","","","")

    private val mTabEntities = mutableListOf<ILottieTabEntity>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_lottie_tab)

        /*val lottieTabA = findViewById<LottieTabLayout>(R.id.lottieTabA)
        val lottieTabB = findViewById<LottieTabLayout>(R.id.lottieTabB)
        val lottieTabC = findViewById<LottieTabLayout>(R.id.lottieTabC)*/

        val ctlLottie = findViewById<CommonTabLayout>(R.id.ctlLottie)
        ctlLottie.setTabData(
            mutableListOf(
                MenuTabEntity(
                    "anim_tab_drink_on.json",
                    R.mipmap.ic_tab_drink_off
                ),
                MenuTabEntity(
                    "anim_tab_shop_on.json",
                    R.mipmap.ic_tab_shop_off
                ),
                MenuTabEntity(
                    "anim_drink_add.json",
                    R.mipmap.ic_tab_drink_off_b
                ),
                MenuTabEntity(
                    "anim_tab_compute_on.json",
                    R.mipmap.ic_tab_tongji_off
                ),
                MenuTabEntity(
                    "anim_tab_my_on.json",
                    R.mipmap.ic_tab_my_off
                )
            )
        )
        ctlLottie.currentTab = 2
    }

}